All menu items are actors now, so remove all the actor property usages.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/499
// Remember if there were setup devices and show the menu
// if we've seen setup devices and we're not hard blocked
if (nDevices > 0)
- this._item.actor.visible = !this._proxy.BluetoothHardwareAirplaneMode;
+ this._item.visible = !this._proxy.BluetoothHardwareAirplaneMode;
else
- this._item.actor.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode;
+ this._item.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode;
if (nConnectedDevices > 0)
/* Translators: this is the number of connected bluetooth devices */
let icon = new St.Icon({ icon_name: 'display-brightness-symbolic',
style_class: 'popup-menu-icon' });
- this._item.actor.add(icon);
- this._item.actor.add(this._slider.actor, { expand: true });
- this._item.actor.connect('button-press-event', (actor, event) => {
+ this._item.add(icon);
+ this._item.add(this._slider.actor, { expand: true });
+ this._item.connect('button-press-event', (actor, event) => {
return this._slider.startDragging(event);
});
- this._item.actor.connect('key-press-event', (actor, event) => {
+ this._item.connect('key-press-event', (actor, event) => {
return this._slider.onKeyPressEvent(actor, event);
});
_sync() {
let visible = this._proxy.Brightness >= 0;
- this._item.actor.visible = visible;
+ this._item.visible = visible;
if (visible)
this._slider.setValue(this._proxy.Brightness / 100.0);
}
const INPUT_SOURCE_TYPE_XKB = 'xkb';
const INPUT_SOURCE_TYPE_IBUS = 'ibus';
-var LayoutMenuItem = class extends PopupMenu.PopupBaseMenuItem {
- constructor(displayName, shortName) {
- super();
+var LayoutMenuItem = GObject.registerClass(
+class LayoutMenuItem extends PopupMenu.PopupBaseMenuItem {
+ _init(displayName, shortName) {
+ super._init();
this.label = new St.Label({ text: displayName });
this.indicator = new St.Label({ text: shortName });
- this.actor.add(this.label, { expand: true });
- this.actor.add(this.indicator);
- this.actor.label_actor = this.label;
+ this.add(this.label, { expand: true });
+ this.add(this.indicator);
+ this.label_actor = this.label;
}
-};
+});
var InputSource = class {
constructor(type, id, displayName, shortName, index) {
// but at least for now it is used as "allow popping up windows
// from shell menus"; we can always add a separate sessionMode
// option if need arises.
- this._showLayoutItem.actor.visible = Main.sessionMode.allowSettings;
+ this._showLayoutItem.visible = Main.sessionMode.allowSettings;
}
_sourcesChanged() {
_syncIndicator() {
if (this._managerProxy == null) {
this._indicator.visible = false;
- this._item.actor.visible = false;
+ this._item.visible = false;
return;
}
this._indicator.visible = this._managerProxy.InUse;
- this._item.actor.visible = this._indicator.visible;
+ this._item.visible = this._indicator.visible;
this._updateMenuLabels();
}
_sync() {
let nItems = this._connectionItems.size;
- this._autoConnectItem.actor.visible = (nItems == 0);
- this._deactivateItem.actor.visible = this._device.state > NM.DeviceState.DISCONNECTED;
+ this._autoConnectItem.visible = (nItems == 0);
+ this._deactivateItem.visible = this._device.state > NM.DeviceState.DISCONNECTED;
if (this._activeConnection == null) {
let activeConnection = this._device.active_connection;
}
_sync() {
- this.item.actor.visible = this._hasCarrier();
+ this.item.visible = this._hasCarrier();
super._sync();
}
let newPos = Util.insertSorted(this._networks, network, this._networkSortFunction);
this._createNetworkItem(network);
- this._itemBox.insert_child_at_index(network.item.actor, newPos);
+ this._itemBox.insert_child_at_index(network.item, newPos);
}
this._syncView();
network.accessPoints.splice(res.ap, 1);
if (network.accessPoints.length == 0) {
- network.item.actor.destroy();
+ network.item.destroy();
this._networks.splice(res.network, 1);
} else {
network.item.updateBestAP(network.accessPoints[0]);
this._itemBox.remove_all_children();
this._networks.forEach(network => {
- this._itemBox.add_child(network.item.actor);
+ this._itemBox.add_child(network.item);
});
adjustment.value = scrollValue;
_selectNetwork(network) {
if (this._selectedNetwork)
- this._selectedNetwork.item.actor.remove_style_pseudo_class('selected');
+ this._selectedNetwork.item.remove_style_pseudo_class('selected');
this._selectedNetwork = network;
this._updateSensitivity();
if (this._selectedNetwork)
- this._selectedNetwork.item.actor.add_style_pseudo_class('selected');
+ this._selectedNetwork.item.add_style_pseudo_class('selected');
}
_createNetworkItem(network) {
network.item = new NMWirelessDialogItem(network);
network.item.setActive(network == this._selectedNetwork);
network.item.connect('selected', () => {
- Util.ensureActorVisibleInScrollView(this._scrollView, network.item.actor);
+ Util.ensureActorVisibleInScrollView(this._scrollView, network.item);
this._selectNetwork(network);
});
- network.item.actor.connect('destroy', () => {
+ network.item.connect('destroy', () => {
let keyFocus = global.stage.key_focus;
- if (keyFocus && keyFocus.contains(network.item.actor))
+ if (keyFocus && keyFocus.contains(network.item))
this._itemBox.grab_key_focus();
});
}
_sync() {
this._toggleItem.label.text = this._client.wireless_enabled ? _("Turn Off") : _("Turn On");
- this._toggleItem.actor.visible = this._client.wireless_hardware_enabled;
+ this._toggleItem.visible = this._client.wireless_hardware_enabled;
this.item.icon.icon_name = this._getMenuIcon();
this.item.label.text = this._getStatus();
_sync() {
let nItems = this._connectionItems.size;
- this.item.actor.visible = (nItems > 0);
+ this.item.visible = (nItems > 0);
super._sync();
}
this._summaryItem.menu.addSettingsAction(_('Network Settings'),
'gnome-network-panel.desktop');
- this._summaryItem.actor.hide();
+ this._summaryItem.hide();
}
(prev, child) => prev + (child.visible ? 1 : 0), 0);
this._summaryItem.label.text = this._getSummaryLabel(nDevices);
let shouldSummarize = nDevices > MAX_DEVICE_ITEMS;
- this._summaryItem.actor.visible = shouldSummarize;
+ this._summaryItem.visible = shouldSummarize;
this.section.actor.visible = !shouldSummarize;
}
: _("Night Light On");
this._disableItem.label.text = disabled ? _("Resume")
: _("Disable Until Tomorrow");
- this._item.actor.visible = this._indicator.visible = visible;
+ this._item.visible = this._indicator.visible = visible;
}
};
// Do we have batteries or a UPS?
let visible = this._proxy.IsPresent;
if (visible) {
- this._item.actor.show();
+ this._item.show();
this._percentageLabel.visible = this._desktopSettings.get_boolean(SHOW_BATTERY_PERCENTAGE);
} else {
// If there's no battery, then we use the power icon.
- this._item.actor.hide();
+ this._item.hide();
this._indicator.icon_name = 'system-shutdown-symbolic';
this._percentageLabel.hide();
return;
_sync() {
if (this._handles.size == 0) {
this._indicator.visible = false;
- this._item.actor.visible = false;
+ this._item.visible = false;
} else {
this._indicator.visible = true;
- this._item.actor.visible = true;
+ this._item.visible = true;
}
}
let showAirplaneMode = this._manager.shouldShowAirplaneMode;
this._indicator.visible = (airplaneMode && showAirplaneMode);
- this._item.actor.visible = (airplaneMode && showAirplaneMode);
+ this._item.visible = (airplaneMode && showAirplaneMode);
this._offItem.setSensitive(!hwAirplaneMode);
if (hwAirplaneMode)
this._createSubMenu();
- this._loginScreenItem.actor.connect('notify::visible',
- () => { this._updateMultiUser(); });
- this._logoutItem.actor.connect('notify::visible',
- () => { this._updateMultiUser(); });
+ this._loginScreenItem.connect('notify::visible',
+ () => { this._updateMultiUser(); });
+ this._logoutItem.connect('notify::visible',
+ () => { this._updateMultiUser(); });
// Whether shutdown is available or not depends on both lockdown
// settings (disable-log-out) and Polkit policy - the latter doesn't
// notify, so we update the menu item each time the menu opens or
this._lockScreenAction.visible ||
this._altSwitcher.actor.visible);
- this._actionsItem.actor.visible = visible;
+ this._actionsItem.visible = visible;
}
_sessionUpdated() {
}
_updateMultiUser() {
- let hasSwitchUser = this._loginScreenItem.actor.visible;
- let hasLogout = this._logoutItem.actor.visible;
+ let hasSwitchUser = this._loginScreenItem.visible;
+ let hasLogout = this._logoutItem.visible;
- this._switchUserSubMenu.actor.visible = hasSwitchUser || hasLogout;
+ this._switchUserSubMenu.visible = hasSwitchUser || hasLogout;
}
_updateSwitchUserSubMenu() {
this._switchUserSubMenu.menu.addMenuItem(item);
this._loginScreenItem = item;
this._systemActions.bind_property('can-switch-user',
- this._loginScreenItem.actor,
+ this._loginScreenItem,
'visible',
bindFlags);
this._switchUserSubMenu.menu.addMenuItem(item);
this._logoutItem = item;
this._systemActions.bind_property('can-logout',
- this._logoutItem.actor,
+ this._logoutItem,
'visible',
bindFlags);
item = new PopupMenu.PopupBaseMenuItem({ reactive: false,
can_focus: false });
- this.buttonGroup = item.actor;
+ this.buttonGroup = item;
let app = this._settingsApp = Shell.AppSystem.get_default().lookup_app(
'gnome-control-center.desktop'
log('Missing required core component Settings, expect trouble…');
this._settingsAction = new St.Widget();
}
- item.actor.add(this._settingsAction, { expand: true, x_fill: false });
+ item.add(this._settingsAction, { expand: true, x_fill: false });
this._orientationLockAction = this._createActionButton('', _("Orientation Lock"));
this._orientationLockAction.connect('clicked', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE),
this._systemActions.activateLockOrientation();
});
- item.actor.add(this._orientationLockAction, { expand: true, x_fill: false });
+ item.add(this._orientationLockAction, { expand: true, x_fill: false });
this._systemActions.bind_property('can-lock-orientation',
this._orientationLockAction,
'visible',
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateLockScreen();
});
- item.actor.add(this._lockScreenAction, { expand: true, x_fill: false });
+ item.add(this._lockScreenAction, { expand: true, x_fill: false });
this._systemActions.bind_property('can-lock-screen',
this._lockScreenAction,
'visible',
bindFlags);
this._altSwitcher = new AltSwitcher(this._powerOffAction, this._suspendAction);
- item.actor.add(this._altSwitcher.actor, { expand: true, x_fill: false });
+ item.add(this._altSwitcher.actor, { expand: true, x_fill: false });
this._actionsItem = item;
this.menu.addMenuItem(item);
this._slider.connect('drag-end', this._notifyVolumeChange.bind(this));
this._icon = new St.Icon({ style_class: 'popup-menu-icon' });
- this.item.actor.add(this._icon);
- this.item.actor.add(this._slider.actor, { expand: true });
- this.item.actor.connect('button-press-event', (actor, event) => {
+ this.item.add(this._icon);
+ this.item.add(this._slider.actor, { expand: true });
+ this.item.connect('button-press-event', (actor, event) => {
return this._slider.startDragging(event);
});
- this.item.actor.connect('key-press-event', (actor, event) => {
+ this.item.connect('key-press-event', (actor, event) => {
return this._slider.onKeyPressEvent(actor, event);
});
_updateVisibility() {
let visible = this._shouldBeVisible();
- this.item.actor.visible = visible;
+ this.item.visible = visible;
}
scroll(event) {